import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCodelabsTemplatesController } from '../../../controllers';
const uctoocodelabsTemplatesRouter = new Router();
const codelabsTemplatesController = new uctooCodelabsTemplatesController();

uctoocodelabsTemplatesRouter.post('/add', requireUser, codelabsTemplatesController.add);
uctoocodelabsTemplatesRouter.post('/edit', requireUser, rowLevelPermission('uctoo/codelabs_templates'), codelabsTemplatesController.edit);
uctoocodelabsTemplatesRouter.post('/del', requireUser, rowLevelPermission('uctoo/codelabs_templates'), codelabsTemplatesController.delete);

//For getting codelabsTemplates with permission control
uctoocodelabsTemplatesRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/codelabs_templates'), codelabsTemplatesController.getSingle);
uctoocodelabsTemplatesRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/codelabs_templates'), codelabsTemplatesController.getMany);
uctoocodelabsTemplatesRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/codelabs_templates'), codelabsTemplatesController.getMany);

//#endregion AutoCreateCode
export default uctoocodelabsTemplatesRouter;
